package org.huntaway.material.cleaner.operate.model.imp;

import org.huntaway.ant.tools.AntUtil;
import org.huntaway.material.cleaner.model.bean.InterParameter;
import org.huntaway.material.cleaner.operate.model.InterOperate;
import org.huntaway.material.cleaner.util.TagsUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AntOperateImp implements InterOperate {
	private final static Logger logger = LoggerFactory.getLogger(AntOperateImp.class);
	TagsUtil tu = null;
	public void move(InterParameter para) {
		logger.info("move:" + para.getSrc().getPath() + "=>" + para.getSrc().getPath());
		AntUtil.fileMove(para.getSrc(), para.getDest());
	}

	public void copy(InterParameter para) {
		logger.info("copy:" + para.getSrc().getPath() + "=>" + para.getSrc().getPath());
		AntUtil.fileCopy(para.getSrc(), para.getDest());
	}

	public void open(InterParameter para) {
		logger.info("open:" + para.getDest());
		//super.open(tu.getPathByTags(dest));
	}

	public void get(InterParameter para) {
		logger.info("get:" + para.getUrl().getPath() + "=>" + para.getSrc().getPath());
		AntUtil.get(para.getUrl(), para.getDest());
	}

	public void delete(InterParameter para) {
		logger.info("delete:" + para.getSrc());
	}

	public void rename(String src, String dest) {
		logger.info("rename:" + src + "=>" + dest);
	}

	public void show(InterParameter para) {
		logger.info("show:" + para.getSrc().getPath());
	}
	public void run(InterParameter para) {
		logger.info("show:" + para.getSrc().getPath());
	}
	
}
